package cn.net.wanji.entity.deviceInfo;

import cn.net.wanji.entity.MyDeviceInfo;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

/**
 * @author guodejun
 * @createTime 2022/11/18 16:28
 * @description
 */
@Data
public class ControllerInfo {
    String deviceId;
    String stateTime;
    String brand;
    String deviceType;
    String deviceSn;
    String basicConfig;
    String systemVersion;
    String mac;
    String ipAddress;
    String port;
    String softwareName;
    @JsonProperty(value = "softwareVersion")
    String softwareVersion;

    String usageStatus;

    public MyDeviceInfo getDevBaseInfo(String siteCode, String deviceTypeCode) {
        MyDeviceInfo devBaseInfo = new MyDeviceInfo();
        devBaseInfo.setSiteCode(siteCode);
        devBaseInfo.setDeviceTypeCode(deviceTypeCode);
        devBaseInfo.setDeviceCode(deviceId);
        if (stateTime != null) {
            devBaseInfo.setStateTime(stateTime.replace("T", " "));
        }
        devBaseInfo.setBrand(brand);
        devBaseInfo.setDeviceType(deviceType);
        devBaseInfo.setSn(deviceSn);
        devBaseInfo.setMac(mac);
        devBaseInfo.setIp(ipAddress);
        devBaseInfo.setPort(port);
        devBaseInfo.setBasicConfig(basicConfig);
        devBaseInfo.setSystemVersion(systemVersion);
        devBaseInfo.setSoftwareName(softwareName);
        devBaseInfo.setSoftwareVersion(softwareVersion);
        devBaseInfo.setUsageStatus(usageStatus);
        return devBaseInfo;
    }
}
